package models

import (
	"time"

	"gorm.io/gorm"
)

const TableNamePaper = "papers"

// Paper mapped from table <papers>
type Paper struct {
	ID          int32          `gorm:"column:id;primaryKey" json:"id"`
	Title       string         `gorm:"column:title;not null" json:"title"`
	Description string         `gorm:"column:description;not null" json:"description"`
	TotalScore  int32          `gorm:"column:total_score;not null;default:100" json:"total_score"`
	CreatorID   int32          `gorm:"column:creator_id;not null" json:"creator_id"`
	CreatedAt   time.Time      `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt   time.Time      `gorm:"column:updated_at;not null;default:CURRENT_TIMESTAMP" json:"updated_at"`
	DeletedAt   gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
}

// TableName Paper's table name
func (*Paper) TableName() string {
	return TableNamePaper
}
